#!/bin/bash -e -v -x

source scripts/common

generateRepositoriesConfig $prRepoUrl
SBT="$SBT_CMD -Dsbt.override.build.repos=true -Dsbt.repository.config=$sbtRepositoryConfig"

case $prDryRun in

  yep)
    echo "DRY RUN"
    ;;

  *)

    # build quick using STARR built upstream, as specified by scalaVersion
    # (in that sense it's locker, since it was built with starr by that upstream job);
    # and run JUnit tests, ScalaCheck tests, partest, OSGi tests, MiMa and scaladoc
    $SBT \
       -Dstarr.version=$scalaVersion \
       -Dscala.build.publishDevelocity=test \
       -warn \
       "setupValidateTest $prRepoUrl" \
       $testExtraArgs \
       testAll

    ;;

esac
